﻿Ext.define('Gnt.examples.advanced.view.LogRecord',
{
    extend: 'Ext.window.Window',
    modal: true,
    width: 600,
    height: 450,
    title: '变更描述',
    layout: 'fit',
    initComponent: function () {
        var me = this;
        me.items = [me.getTextArea()];
        me.buttons = [
            { text: '确定', handler: function () { me.save(); } },
            { text: '取消', handler: function () { me.close(); } }
        ];
        me.callParent(arguments);
    },
    getTextArea: function () {
        if (!this.textArea) {
            this.textArea = new Ext.form.field.TextArea({
                emptyText: '请写一些内容'
            });
        }
        return this.textArea;
    },
    save: function () {
        var me = this;
        Ext.Ajax.request({
            url: '/api/services/app/gantt/CreateChangeLog',
            params: { ProjectId: _projectId, Note: me.getTextArea().getValue() },
            success: function (response)
            {
                var text = response.responseText;
                me.fireEvent("savesuccess");
            }
        });
    }
});
